<template>
	<div id="app">
		<router-view v-wechat-title='$route.meta.title'></router-view>
		<a href="javascript:;" style="text-decoration:none;display: none;" id="top">
			<div style="width: 40px;height: 40px;border: 1px solid rgb(0, 0, 0,0.1);
		position: fixed;bottom: 100px;right: 100px;border-radius: 50px;box-shadow: 0px 0px 10px rgb(0, 0, 0, 0.1);"
				align="center">
				<i class="el-icon-caret-top" style="font-size: 25px;line-height: 40px;color: #3399ff;"></i>
			</div>
		</a>
	</div>
</template>

<script>
	
	import $ from "jquery"
	
	var scrolltop = null;
	window.onscroll = function(e) {
		var e = e;
		scrolltop = document.documentElement.scrollTop;
		$("#top").stop();
		if (scrolltop > 250) {
			$("#top").fadeIn(300);
		} else {
			$("#top").fadeOut(300);
		}
	}
	
	$(function(){
		$("#top").click(function(){
			$('body,html').animate({scrollTop:0},500); 
		})
	})

	export default {
		name: 'app',
		created() {

		},
		components: {

		}
	}
</script>

<style>
	* {
		margin: 0;
		padding: 0;
	}

	::-webkit-scrollbar {
		width: 0px;
	}
</style>